<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@ page import="javax.sql.*"%>
<%@ page import="model.*"%>

<html:html>
<head>
    <title>Review Application Homepage</title>
</head>

<body>
<font size="6"> Reviewer's Homepage</font><br>

<a href="/CSE135_Project_struts/login/invalidate.jsp">Log out</a><br>
<br>

Welcome <%=request.getUserPrincipal().getName()%><p>
Please review the applications below:<p>

<%
RowSet crsAppsIDs = (RowSet)request.getAttribute("crsAppsID");

while(crsAppsIDs.next()){
	int appID = crsAppsIDs.getInt("application");
	
	RowSet crsAppInfo = ApplicationModel.getApplicantInfoFor(appID);
	crsAppInfo.next();
	
	String firstname = crsAppInfo.getString("first_name");
	String middleinitial = crsAppInfo.getString("middle_initial");
	String lastname = crsAppInfo.getString("last_name");
	%><html:link action="/ApplicationReview">
	<html:param name="applicant" value="<%=Integer.toString( crsAppsIDs.getInt(\"application\") )%>"/>
	<%
	out.println(firstname+" "+middleinitial+" "+lastname);
	%></html:link><% 
	out.println("<br>");
}
%>

</body>
</html:html>